using Z = Mint<998244353>;
void solve()
{
  int n, k;
  cin >> n >> k;

  Combination<998244353> comb(2 * n);
  
  Z ans;
  rep(i, 0, n) {
    if (i < n - k) {
      continue;
    }
    Z lv = comb.fac_[n - i + 1], rv = comb.fac_[n - i];
    lv *= power<Z>(n - i + 1, k - n + i);
    rv *= power<Z>(n - i, k - n + i + 1);

    lv -= rv;
    ans += lv * comb.C(n, i) * comb.fac_[n - i];
  }
  cout << ans;
}